#ifndef PLAYER_H
#define PLAYER_H

#include "Movable.h"
#include <vector>

class Projectile;


// The player can move and shoot based on input.
class Player : public Movable
{
public:
	Player(int playerIndex, int x, int y);
	virtual ~Player();

	virtual void getTimedDesiredMove(int& hDirection, int& vDirection);

	virtual void handleCollision(GameObject* gameObject);
	virtual bool isPassable(const GameObject* gameObject) const;

	virtual void setDrawColor() const;
	void drawObject(int row, int col) const;

	// Function for the projectile to notify it is destroyed.
	void projectileDestroyed(Projectile* projectile);

	// Disable/enable input. Useful when the player enters the room.
	void setIgnoreInput(bool ignoreInput);

private:
	void spawnProjectile(char id, int x, int y, int hDirection, int vDirection);

	int lastHVelocity;
	int lastVVelocity;

	const int playerIndex;

	std::vector<Projectile*> ownedProjectiles;
	const unsigned int projectilesAllowed;
	int gold;

	bool ignoreInput;
};

#endif